<?php
class Model_DbTable_Questions extends HackerU_Db_Table
{
	public function getNumOfQuestions($testId)
	{
		$numOfQuestions = 0;
		$testId = (int)$testId;
		$sql = "select count(id) as numOfQuestions from $this->name where testId = $testId";
		$result = $this->fetchByQuery($sql);
		if($result){
			$numOfQuestions = (int)$result[0]->numOfQuestions;
		}
		return $numOfQuestions;
;	}
}